﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SQLite.Net;
using SQLite.Net.Interop;
using SQLite.Net.Platform.WinRT;
using Windows.Storage;

namespace Wasion.HHU.Data
{
    public class DbConn
    {
        private static SQLiteConnection connection;
        public SQLiteConnection Connection
        {
            get
            {
                if (connection == null)
                {
                    ISQLitePlatform platform = new SQLitePlatformWinRT();
                    var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, "hhu.db");
                    //var path = ".\\DB\\hhu.db";
                    //Uri uri = new Uri("ms-appx:///DB/hhu.db");
                    connection = new SQLiteConnection(platform, path);
                }

                return connection;
            }
        }
    }
}
